ResCopy value of theSource, theTarget, "XFCN", "GetVolume"
if "OK" is in the result then
ResCopy value of theSource, theTarget, "XCMD", "SetVolume"
if "OK" is in the result then answer "Installation complete." with "Ok"
else error "SetVolume"
else error "GetVolume"
end if
end mouseUp
on error what
beep
answer "Unable to install " & what & "." with "Cancel"
end error
-- part 2 (field)
-- low flags: 00
-- high flags: 0001
-- rect: left=42 top=83 right=261 bottom=467
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 0
-- font id: 3
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name:
-- part 3 (field)
-- low flags: 00
-- high flags: 0004
-- rect: left=116 top=39 right=64 bottom=407
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 6
-- text size: 18
-- style flags: 17408
-- line height: 24
-- part name:
-- part contents for card part 2
----- text -----
GetVolume and SetVolume are an XFCN and XCMD that allow you to find out and set the volume of the speaker within a script. The format of the commands are:
SetVolume(<volume>)
and
GetVolume()
Where <volume> is between 0 and 7. The parenthesis are required for GetVolume to be recognized as a XFCN by HyperCard.
These routines where written by Steven Kienle [72330,111] in TML Pascal, source code is included in the StuffIt file with this Stack.